// @Describe: 事件处理模块
package core

import (
	"wormhole/pkg/event"
	"wormhole/protos/hole"
)

func (s *holeServer) EventAdd(ripple *hole.Ripple) {
	s.EventChan <- ripple
}

func (s *holeServer) EventHandle() {
	for ripple := range s.EventChan {
		if ripple.Event == event.OfflineEvent {
			s.OfflineDevice(ripple)
		} else {
			s.OnlineDevice(ripple)
		}
	}
}
